<?php
$f = $_FILES['f'];
if($f){
	$MAX_W = 960;
	$MAX_H = 960;

	$path = 'file'.DIRECTORY_SEPARATOR.date('Y').DIRECTORY_SEPARATOR.date('m').DIRECTORY_SEPARATOR.date('d').DIRECTORY_SEPARATOR;
	$file_path = __DIR__.DIRECTORY_SEPARATOR.$path;
	if (!is_dir($file_path)) {

			$t = mkdir($file_path, 0777, true);
	}
	$name = md5(time().serialize($f)).'.jpg';

	$nf = $file_path.$name;
	move_uploaded_file($f['tmp_name'], $nf);
	echo $path.$name;
	exit;
}
die('err');
